# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-applications
pkgname=kmime
pkgver=24.02.2
pkgrel=0
pkgdesc="Library for handling mail messages and newsgroup articles"
# armhf blocked by extra-cmake-modules
arch="all !armhf"
url="https://community.kde.org/KDE_PIM"
license="LGPL-2.0-or-later"
depends_dev="
	kcodecs-dev
	ki18n-dev
	qt6-qtbase-dev
	"
makedepends="$depends_dev
	extra-cmake-modules
	samurai
	"
subpackages="$pkgname-dev $pkgname-lang"
_repo_url="https://invent.kde.org/pim/kmime.git"
source="https://download.kde.org/stable/release-service/$pkgver/src/kmime-$pkgver.tar.xz"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failure -E "kmime-(rfc2231|dateformatter|header|message)test"
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
85c217a65890588899ea32a5517a1107fc41e60903f2613a7b3822b7c8370d0c39fd8971bfa3ad2d0c1b7c5fa763d9d9b9aeaa6f42e0c5eb3ba7bd275b43f840  kmime-24.02.2.tar.xz
"
